<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <title>Index Opening and Creation - Zend Framework Manual</title>

    <link href="../css/shCore.css" rel="stylesheet" type="text/css" />
    <link href="../css/shThemeDefault.css" rel="stylesheet" type="text/css" />
    <link href="../css/styles.css" media="all" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>Zend Framework</h1>
<h2>Programmer's Reference Guide</h2>
<ul>
    <li><a href="../en/learning.lucene.index-opening.html">Inglês (English)</a></li>
    <li><a href="../pt-br/learning.lucene.index-opening.html">Português Brasileiro (Brazilian Portuguese)</a></li>
</ul>
<table width="100%">
    <tr valign="top">
        <td width="85%">
            <table width="100%">
                <tr>
                    <td width="25%" style="text-align: left;">
                    <a href="learning.lucene.index-structure.html">Lucene Index Structure</a>
                    </td>

                    <td width="50%" style="text-align: center;">
                        <div class="up"><span class="up"><a href="learning.lucene.html">Getting Started with Zend_Search_Lucene</a></span><br />
                        <span class="home"><a href="manual.html">Programmer's Reference Guide</a></span></div>
                    </td>

                    <td width="25%" style="text-align: right;">
                        <div class="next" style="text-align: right; float: right;"><a href="learning.lucene.indexing.html">Indexing</a></div>
                    </td>
                </tr>
            </table>
<hr />
<div id="learning.lucene.index-opening" class="section"><div class="info"><h1 class="title">Index Opening and Creation</h1></div>
    

    <p class="para">
        All index operations (e.g., creating a new index, adding a document to the index, deleting a
        document, searching through the index) need an index object. One can be obtained using one
        of the following two methods.
    </p>

    <div class="example" id="learning.lucene.index-opening.creation"><div class="info"><p><b>Example #1 Lucene Index Creation</b></p></div>
        

        <pre class="programlisting brush: php">
$index = Zend_Search_Lucene::create($indexPath);
</pre>

    </div>

    <div class="example" id="learning.lucene.index-opening.opening"><div class="info"><p><b>Example #2 Lucene Index Opening</b></p></div>
        

        <pre class="programlisting brush: php">
$index = Zend_Search_Lucene::open($indexPath);
</pre>

    </div>
</div>
        <hr />

            <table width="100%">
                <tr>
                    <td width="25%" style="text-align: left;">
                    <a href="learning.lucene.index-structure.html">Lucene Index Structure</a>
                    </td>

                    <td width="50%" style="text-align: center;">
                        <div class="up"><span class="up"><a href="learning.lucene.html">Getting Started with Zend_Search_Lucene</a></span><br />
                        <span class="home"><a href="manual.html">Programmer's Reference Guide</a></span></div>
                    </td>

                    <td width="25%" style="text-align: right;">
                        <div class="next" style="text-align: right; float: right;"><a href="learning.lucene.indexing.html">Indexing</a></div>
                    </td>
                </tr>
            </table>
</td>
        <td style="font-size: smaller;" width="15%"> <style type="text/css">
#leftbar {
	float: left;
	width: 186px;
	padding: 5px;
	font-size: smaller;
}
ul.toc {
	margin: 0px 5px 5px 5px;
	padding: 0px;
}
ul.toc li {
	font-size: 85%;
	margin: 1px 0 1px 1px;
	padding: 1px 0 1px 11px;
	list-style-type: none;
	background-repeat: no-repeat;
	background-position: center left;
}
ul.toc li.header {
	font-size: 115%;
	padding: 5px 0px 5px 11px;
	border-bottom: 1px solid #cccccc;
	margin-bottom: 5px;
}
ul.toc li.active {
	font-weight: bold;
}
ul.toc li a {
	text-decoration: none;
}
ul.toc li a:hover {
	text-decoration: underline;
}
</style>
 <ul class="toc">
  <li class="header home"><a href="manual.html">Programmer's Reference Guide</a></li>
  <li class="header up"><a href="manual.html">Programmer's Reference Guide</a></li>
  <li class="header up"><a href="learning.html">Learning Zend Framework</a></li>
  <li class="header up"><a href="learning.lucene.html">Getting Started with Zend_Search_Lucene</a></li>
  <li><a href="learning.lucene.intro.html">Zend_Search_Lucene Introduction</a></li>
  <li><a href="learning.lucene.index-structure.html">Lucene Index Structure</a></li>
  <li class="active"><a href="learning.lucene.index-opening.html">Index Opening and Creation</a></li>
  <li><a href="learning.lucene.indexing.html">Indexing</a></li>
  <li><a href="learning.lucene.searching.html">Searching</a></li>
  <li><a href="learning.lucene.queries.html">Supported queries</a></li>
  <li><a href="learning.lucene.pagination.html">Search result pagination</a></li>
 </ul>
 </td>
    </tr>
</table>

<script type="text/javascript" src="../js/shCore.js"></script>
<script type="text/javascript" src="../js/shAutoloader.js"></script>
<script type="text/javascript" src="../js/main.js"></script>

</body>
</html>